﻿@model PagerModel
@*BinXiao 2011.10.20*@
<script type="text/javascript">
    function goPage(pageN) {

        document.getElementById("pageindex").value = pageN;
        document.getElementById("@(this.Model.GetForm)").submit();
    }
</script>
<input name="pageindex" type="hidden" id="pageindex" />
@if (Model.RecordQty > Model.PageSize)
{
   
    <div class="pager">
        <span class="pager-rec">@(this.Model.RecordQty)条数据&nbsp;&nbsp;共@(this.Model.PageQty)页&nbsp;&nbsp;</span>
        <span class="pager-first"><a href="javascript:goPage(1);">第一页</a></span>
        @if (this.Model.PageQtyPagerModel.PageIndex >= 2)
        {
            <span class="page-ellipsis"><a href="javascript:goPage(@(this.Model.PageQtyPagerModel.PageSize * (this.Model.PageQtyPagerModel.PreviousPageIndex - 1) + 1));">
                ...</a></span>
        }
        @for (int index = this.Model.PageQtyPagerModel.BeginPageIndex; index <= this.Model.PageQtyPagerModel.EndPageIndex; index++)
        {

            if (index > this.Model.PageQty) { break; }

            if (this.Model.PageIndex == index)
            {
            <span class="pager-cur">@(index)</span>
            }
            else
            {
            <span class="pager-num"><a href="javascript:goPage(@(index));">@(index)</a></span>
            }

            if (index == this.Model.PageQtyPagerModel.EndPageIndex && index < this.Model.PageQty)
            {
            <span class="page-ellipsis"><a href="javascript:goPage(@(index + 1));">...</a></span>
            }

        }
        <span class="pager-last"><a href="javascript:goPage(@(this.Model.LastPageIndex));">最后一页</a></span>
    </div>
}